package parser;

import antlr.RecognitionException;

class YieldStmt extends Stmt {
    
    Expr value;
    int protection_depth;
    
    YieldStmt(Expr value, int protection_depth) {
        this.value = value;
        yields = true;
        this.protection_depth = protection_depth;
    }

    void write(ByteStream out) throws RecognitionException {
        out.line(line);
        value.write(out);
        out.write(Opcodes.YIELD);
    }

}
